package com.example.maxboxtwo.utils.listeners;

import android.util.Log;
import android.widget.ImageView;

import androidx.viewpager.widget.ViewPager;

import com.example.maxboxtwo.R;


public class FragmentPageChangeListener implements ViewPager.OnPageChangeListener {
    private ImageView dark;
    private ImageView ligth;

    public FragmentPageChangeListener(ImageView dark, ImageView ligth) {
        this.dark = dark;
        this.ligth = ligth;
    }

    @Override
    public void onPageScrolled(int i, float v, int i1) {

    }

    @Override
    public void onPageSelected(int i) {
        Log.i("name",String.valueOf(i));
        switch (i){
            case 0:
                dark.setImageResource(R.drawable.the_current_progress);
                ligth.setImageResource(R.drawable.non_current_progress);
                break;
            case 1:
                ligth.setImageResource(R.drawable.the_current_progress);
                dark.setImageResource(R.drawable.non_current_progress);
                break;
            default:
                break;
        }

    }

    @Override
    public void onPageScrollStateChanged(int i) {

    }
}
